-
Notifications
You must be signed in to change notification settings - Fork 645
ConfigCacheClientTest.java: fix flaky test due to race condition #6306
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…y fail: getBlocking_hasNoCachedValueAndFileReadTimesOut_returnsNull
📝 PRs merging into main branchOur main branch should always be in a releasable state. If you are working on a larger change, or if you don't want this change to see the light of the day just yet, consider using a feature branch first, and only merge into the main branch when the code complete and ready to be released. |
1 similar comment
📝 PRs merging into main branchOur main branch should always be in a releasable state. If you are working on a larger change, or if you don't want this change to see the light of the day just yet, consider using a feature branch first, and only merge into the main branch when the code complete and ready to be released. |
Generated by 🚫 Danger |
Coverage Report 1Affected Products
Test Logs |
Unit Test Results 40 files + 24 40 suites +24 1m 23s ⏱️ + 1m 8s Results for commit 40ffdc0. ± Comparison against base commit 2f851c7. This pull request removes 107 and adds 309 tests. Note that renamed tests count towards both. |
Size Report 1Affected ProductsNo changes between base commit (2f851c7) and merge commit (8dc5b95).Test Logs |
Startup Time Report 1Note: Layout is sometimes suboptimal due to limited formatting support on GitHub. Please check this report on GCS. Notes
Startup Times
|
Fix a race condition in
ConfigCacheClientTest.javacausing the testgetBlocking_hasNoCachedValueAndFileReadTimesOut_returnsNullto flakily fail.The failure looks like this:
The reason for the flake is that sometimes the thread scheduler will run the code that calls
ConfigStorageClient.read()beforegetBlocking()returns; therefore,getBlocking()would return a non-null object in that case. The fix was to cause the mockedread()method to block indefinitely, making it impossible for the read not to timeout.Here is an example where this flaky failure showed up in CI: https://github.com/firebase/firebase-android-sdk/pull/6290/checks?check_run_id=30611216190
#no-changelog